 {% extends 'base4bs.html' %}
 {% block content %}
    <div class="container">
        <form method="post" >
            {{ form.csrf_token }} <!-- 渲染CSRF令牌隐藏字段 -->
            <div class="mb-3 row">
                {{ form.title.label(class='col-sm-1 col-form-label') }}
                <div class="col-sm-11">
                    {{ form.title(class='form-control') }}
                </div>

                 {% for error in form.title.errors %}
                    <small class="error">{{error}}</small>
                {% endfor %}
            </div>
            <div class="mb-3 row">
                {{ form.body.label(class='col-sm-1 col-form-label') }}
                <div class="col-sm-11">
                    {{ form.body(class='form-control') }}
                </div>
                 {% for error in form.body.errors %}
                    <small class="error">{{error}}</small>
                {% endfor %}
            </div>
            <div class="mb-3">
            {{ form.save(class='btn btn-secondary') }}
            {{ form.publish(class='btn btn-primary') }}
            </div>
        </form>
    </div>
 {% endblock %}
